{% extends "base.html" %}

{% block content %}
    <h2>Manage portfolio</h2>
    
    <div>
        <a href="/manage/portfolio?action=add">Add portfolio item</a>
    </div>
    
    <table class="portfolio-table">
    <tr>
        <th>Category</th>
        <th>Title</th>
        <th>Description</th>
        <th>Image</th>
        <th>Actions</th>
    </tr>
    {% for item in items %}
        <tr>
        <td>
            <b>{{ item.category.title|escape }}</b>
        </td>
        <td>
            <b>{{ item.name|escape }}</b>
        </td>
        <td>
            <blockquote>{{ item.description|escape }}</blockquote>
        </td>
        <td>
            <a href="/portfolio/image/{{ item.key.id }}/full" title="{{ item.name|escape }}">
                <img src="/portfolio/image/{{ item.key.id }}/thumb" alt="{{ item.name|escape }}">
            </a>
        </td>
        <td>
            <a href="/manage/portfolio?id={{ item.key.id }}&action=edit" title="Edit item">
                Изменить
            </a>
            <a href="/manage/portfolio?id={{ item.key.id }}&action=delete" title="Edit item">
                Удалить
            </a>
        </td>
        </tr>
    {% endfor %}
    </table>
    
{% endblock %}